<?php

class TopReality extends AbstractBox {
	
	protected $template = 'reality/top-reality.tpl';

	protected function setup() {
		$realityRepository = new RealityRepository();
		$realityRepository->addAdditionalWhere(array('column' => 'view_count', 'value' => 0, 'comparator' => '>'));
		$realityRepository->addAdditionalWhere(array('column' => 'main_image', 'value' => '', 'comparator' => '!='));
		$realityRepository->addOrderBy(array('view_count' => 'DSEC'));
		$realityRepository->setLimit(4);
		MySmarty::assign('topReality', $realityRepository->getAll());
	}
}

?>